//资源概览
(function($){
	$(function(){
		var resizePage = (function () {
            $("body").height($(window).height());
            var ww = $(window).width(),
                wh = $("body").innerHeight(),
                searchPanelH = $(".search-panel").outerHeight(true),
                $virtualContent = $(".resources-show-panel");

            $virtualContent.height(wh - searchPanelH);
            return arguments.callee;
        })();

        $(window).resize(resizePage);
        
		//CPU使用状况
		drawRing({
			parent : document.getElementById("cpuPercent"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 100,
			color : ['#e8edf0' , '#ff6858'],
			textColor : '#ff6858',
			textSize : '16px',
			animated : true
		});
		
		//内存使用状况
		drawRing({
			parent : document.getElementById("memoryPercent"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 100,
			color : ['#e8edf0' , '#61d1bf'],
			textColor : '#61d1bf',
			textSize : '16px',
			animated : true
		});
		
		//硬盘使用状况
		drawRing({
			parent : document.getElementById("diskPercent"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 100,
			color : ['#e8edf0' , '#1dabff'],
			textColor : '#1dabff',
			textSize : '16px',
			animated : true
		});
		
		//卷组使用状况
		drawRing({
			parent : document.getElementById("chartVolume"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 30,
			color : ['#e8edf0' , '#ff6858'],
			textColor : '#ff6858',
			textSize : '16px',
			animated : true
		});
		
		//卷组快照使用状况
		drawRing({
			parent : document.getElementById("chartVolumeSnapshot"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 50,
			color : ['#e8edf0' , '#61d1bf'],
			textColor : '#61d1bf',
			textSize : '16px',
			animated : true
		});
		
		//卷组与卷组快照总大小使用状况
		drawRing({
			parent : document.getElementById("chartVolumeAll"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 60,
			color : ['#e8edf0' , '#1dabff'],
			textColor : '#1dabff',
			textSize : '16px',
			animated : true
		});
		
		//安全组
		drawRing({
			parent : document.getElementById("chartSafetyGroup"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 70,
			color : ['#e8edf0' , '#ff6858'],
			textColor : '#ff6858',
			textSize : '16px',
			animated : true
		});
		
		//外网IP个数
		drawRing({
			parent : document.getElementById("chartIPCount"),
			width : 80,
			radius : 35,
			arc : 5,
			percent : 103,
			color : ['#e8edf0' , '#61d1bf'],
			textColor : '#61d1bf',
			textSize : '16px',
			animated : true
		});
		
		//鼠标悬浮提示
		$(".quota-prompt").animateTip({
			my:"right top+10",
			at:"left+30 bottom",
			arrowStyle:{
					"left":"auto",
					"right":"14px"
				}
		});
		$(".quota-news").animateTip({
			my:"right top+10",
			at:"left+54 bottom",
			arrowStyle:{
					"left":"auto",
					"right":"36px"
				}
		});
		
		//添加滚动条
		$(".resources-show-panel").niceScroll({
            cursorcolor:"#0099ff",
            autohidemode:false
        });
		
		
	})
})(jQuery)

